<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.5 of April 16, 2007 on October 19, 2007 at 6:15:00 am</time-stamp>


<class>
<name>Enums</name>
<environment>SpaceTrader</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>SpaceTrader</category>
<attributes>
<package>SpaceTrader</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>SpaceTrader.Enums class</class-id> <category>instance creation</category>

<body package="SpaceTrader" selector="new">new
	"Answer a newly created and initialized instance."

	^self error: ['Cannot initialize'].</body>
</methods>

<methods>
<class-id>SpaceTrader.Enums class</class-id> <category>enums</category>

<body package="SpaceTrader" selector="Actions">Actions
	|dic|
	dic := Dictionary new.
	dic
		add: #Attack -&gt; 1;
		add: #Ignore -&gt; 2;
		add: #Flee -&gt; 3;
		add: #Trade -&gt; 4;
		add: #Submit -&gt; 5;
		add: #Surrender -&gt; 6;
		add: #Plunder -&gt; 7.
	^dic.</body>

<body package="SpaceTrader" selector="CargoItems">CargoItems
	|dic|
	dic := IdentityDictionary new.
	dic
		add: #NA -&gt; -1;
		add: #Water -&gt; 0;
		add: #Furs -&gt; 1;
		add: #Food -&gt; 2;
		add: #Ore -&gt; 3;
		add: #Games -&gt; 4;
		add: #Firearms -&gt; 5;
		add: #Medicine -&gt; 6;
		add: #Machines -&gt; 7;
		add: #Narcotics -&gt; 8;
		add: #Robots -&gt; 9.
	^dic.</body>

<body package="SpaceTrader" selector="PlanetSize">PlanetSize
	|dic|
	dic := IdentityDictionary new.
	dic 
		add: #Tiny -&gt; 0;
		add: #Small -&gt; 1;
		add: #Medium -&gt; 2;
		add: #Large -&gt; 3;
		add: #Huge -&gt; 4;
		add: #Gargantuan -&gt; 5.
	^dic</body>

<body package="SpaceTrader" selector="TechLevels">TechLevels
	|dic|
	dic := IdentityDictionary new.
	dic 
		add: #PreAgricultural -&gt; 0;
		add: #Agricultural -&gt; 1;
		add: #Medieval -&gt; 2;
		add: #Renaissance -&gt; 3;
		add: #EarlyIndustrial -&gt; 4;
		add: #Industrial -&gt; 5;
		add: #PostIndustrial -&gt; 6;
		add: #HiTech -&gt; 7;
		add: #Unavailable -&gt; 8.
	^dic</body>
</methods>

<methods>
<class-id>SpaceTrader.Enums class</class-id> <category>consts</category>

<body package="SpaceTrader" selector="TradeItems">TradeItems

	|dic|
	dic := IdentityDictionary new.
	dic
		add: (self CargoItems at: #Water) -&gt; #(#PreAgricultural 30 3);
		add: (self CargoItems at: #Furs) -&gt; #(#PreAgricultural 250 10);
		add: (self CargoItems at: #Food) -&gt; #(#Agricultural 100 5);
		add: (self CargoItems at: #Ore) -&gt; #(#Renaissance 350 20);
		add: (self CargoItems at:  #Games) -&gt; #(#PostIndustrial 250 -10);
		add: (self CargoItems at: #Firearms) -&gt; #(#Industrial 1250 -75);
		add: (self CargoItems at: #Medicine) -&gt; #(#PostIndustrial 650 -20);
		add: (self CargoItems at: #Machines)	-&gt; #(#Industrial 900 -30);
		add: (self CargoItems at: #Narcotics) -&gt; #(#Industrial 3500 -125);
		add: (self CargoItems at:  #Robots) -&gt; #(#HiTech 5000 -150).
	^dic.</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>SpaceTrader.Enums</class-id> <category>initialize-release</category>

<body package="SpaceTrader" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	" *** Replace this comment with the appropriate initialization code *** "
	^self error: ['Cannot initialize'].</body>
</methods>

</st-source>
